home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 451 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: clamage@Eng.sun.com (Steve Clamage)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Returning void
  5. Date: 22 Feb 1996 20:59:06 GMT
  6. Organization: Sun Microsystems Inc.
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <4gil6k$22t@engnews1.Eng.Sun.COM>
  9. References: <4gia2l$5og@mulga.cs.mu.OZ.AU>
  10. Reply-To: clamage@Eng.sun.com
  11. NNTP-Posting-Host: taumet.eng.sun.com
  12. Content-Type: text
  13. X-Nntp-Posting-Host: taumet.eng.sun.com
  14. Content-Length: 1095
  15. X-Lines: 27
  16. Originator: clamage@taumet
  17.  
  18. In article 5og@mulga.cs.mu.OZ.AU, fjh@munta.cs.mu.OZ.AU (Fergus Henderson) writes:
  19. >Michael Cook <mcook@cognex.com> writes:
  20. >
  21. >>Surely we wouldn't want the standard to allow `void&'.
  22. >
  23. >No, after all, that might let a tiny little bit of orthogonality
  24. >creep into C++, and then who knows what people might want next!
  25. >
  26. >;-)
  27.  
  28. I realize Fergus is kidding, but we should also note that the language
  29. definition says there are no objects of type void, you can't have
  30. a function parameter of type void, you can't return an expression
  31. from a function declared to return void, and you can't dereference
  32. a void*. In the face of all that, allowing void& would seem kind of
  33. inconsistent.
  34.  
  35. I think just asserting that void& is a valid type wouldn't be enough.
  36. We'd have to address the prohibitions above, and also say how to (or if
  37. you do) initialize a void& variable, how to (or if you do) pass an argument
  38. to a void& parameter, and how to return a void& from a function. Then we'd
  39. have to assess whether the benefits would be worth the extra complication.
  40.  
  41. ---
  42. Steve Clamage, stephen.clamage@eng.sun.com
  43.  
  44.  
  45. [ To submit articles: Try just posting with your newsreader.
  46.               If that fails, use mailto:std-c++@ncar.ucar.edu
  47.   FAQ:    http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
  48.   Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  49.   Comments? mailto:std-c++-request@ncar.ucar.edu
  50. ]
  51.